<template>
    <div>
      <!-- 顶部导航 -->
      <van-nav-bar title="我的" />

      <!-- 登录注册 -->
      <div class="login-resign" @click="goLogin">
          <!-- 左侧头像 -->
          <van-image
            round
            width="60px"
            height="60px"
            src="https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg"
          />
          <!-- 右侧盒子 -->
          <div class="right_box">
            <div class="left">
              <div class="top">登录/注册</div>
              <div class="bottom">
                <van-icon class="iconfont icon-shouji" />
                <div class="text">暂时无绑定手机号</div>
              </div>
            </div>
              <van-icon name="arrow" size="11" color="white"/>
          </div>
      </div>

      <!-- 优惠券宫格 -->
      <div class="grid">
        <div class="item" @click="$router.push('/balance')">
            <div class="top">
              <div class="number money">0.00</div>
              <div class="company">元</div>
            </div>
            <div class="bottom">我的余额</div>
        </div>

        <div class="item">
            <div class="top">
              <div class="number coupon">0</div>
              <div class="company">个</div>
            </div>
            <div class="bottom">我的优惠</div>
        </div>

        <div class="item">
            <div class="top">
              <div class="number integral">0</div>
              <div class="company">分</div>
            </div>
            <div class="bottom">我的积分</div>
        </div>

      </div>

      <!-- 我的订单下面单元格 -->
      <van-cell-group class="group">

        <van-cell title="我的订单" is-link>
          <template #icon>
            <i class="iconfont icon-dingdan"></i>
          </template>
        </van-cell>

        <van-cell title="积分商城" is-link>
          <template #icon>
            <i class="iconfont icon-jifen"></i>
          </template>
        </van-cell>

        <van-cell title="硅谷外卖卡" is-link @click="toCard">
         <template #icon>
            <i class="iconfont icon-vip"></i>
          </template>
        </van-cell>

        <van-cell></van-cell>

      </van-cell-group>
      <!-- 服务中心 -->
        <div class="service">
          <van-cell title="服务中心" is-link to="/service">
            <template #icon>
              <i class="iconfont icon-fuwu"></i>
            </template>
          </van-cell>
          <van-cell >
          </van-cell>
        </div>

      <!-- 底部导航栏 -->
    </div>

</template>
<script setup>
import { useRouter } from 'vue-router'
const router = useRouter()
const goLogin = function () {
  router.push('/login')
}
const toCard = function () {
  router.push('/card')
}
</script>

<script>
export default {
  name: 'my-index'
}
</script>

<style lang="less" scoped>
 .van-nav-bar {
  background: #0a92e7;
 }

 /deep/ .van-nav-bar__title {
  color: white;
  font-size: 18px;
}
.login-resign {
  height: 200px;
  padding: 20px 17px 20px 10px;
  margin-top: 1px;
  background-color: #0a92e7;
  display: flex;
  .right_box {
    margin-left: 15px;
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    .left {
      .top {
        font-size: 17px;
        color: #fff;
      }
      .bottom{
        display: flex;
        margin-top: 14px;
        .icon-shouji:before {
          margin-left: -4px;
        }
        .icon-shouji{
          font-size: 40px;
          color: #fff;
          margin-left: -15px;
        }
        .text {
          font-size: 12px;
          color: #fff;
        }
      }
    }
  }
}

.grid {
    width: 100%;
    height: 160px;
    display: flex;

    .item {
        flex: 1;
        height: 100%;
        background-color: #fff;
        border-bottom: 1px solid #f1f1f1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        .number {
            font-size: 46px;
        }
        .company {
            font-size: 24px;
            margin-bottom: 10px;
        }
        .bottom {
            font-size: 24px;
            margin-top: 15px;
        }
        .money {
          color: #ff9900;
        }
        .coupon {
            color: #ff5f3e;
        }
        .integral {
            color: #6ac20b;
        }
        .top {
            display: flex;
            align-items: end;
        }
        &:nth-child(2) {
            border-left: 1px solid #f1f1f1;
            border-right: 1px solid #f1f1f1;
        }
    }
}

.group {
    padding-left: 35px;
    overflow: visible;
  .iconfont {
    margin-right: 10px;
  }
  .van-cell--clickable {
    overflow: visible;
  }
  .icon-dingdan {
    font-size: 34px;
    color: #4fc29f;
    margin-left: -40px;
  }
  .icon-jifen  {
    font-size: 50px;
    color: #ff5f3e;
    margin-left:-55px ;
  }
  .icon-vip {
    font-size: 40px;
    color: #ff9e0d;
    margin-left: -45px;
  }
}
.service {
  .icon-fuwu {
    margin-right: -2px;
    color: #02a774;
    font-size: 40px;
  }
}
</style>
